
<%--
  Created by IntelliJ IDEA.
  User: 郭苍奇
  Date: 2020/8/20
  Time: 19:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page isELIgnored="false" %>
<html>
<head>
    <title>商品信息管理</title>
    <link rel="shortcut icon" type="imagges/x-ion" href="resources/img/wareHouse.png.jpg"/>
    <!--                                              网页小图标  -->
    <style>
        #edit{
            width: 65px;
            height: 30px;
            background-color: cornflowerblue ;
            border-radius: 5px;  /* 按键弧度*/


        }
        #search{
            width: 65px;
            height: 30px;
            background-color: #FF7F50;
            border-radius: 5px;  /* 按键弧度*/
        }
        #img{
            height: 20px;
            width: 20px;
            position:absolute;   /*<! 绝对位移>*/
            left: 200px;
            top:85px;
        }
        #insearch{
            height: 30px;
            width: 300px;
            padding-left: 25px; /*  内容与边框的距离*/
        }
        #add{
            width: 20px;
            margin-left: 540px;
            margin-top: 15px;
        }

        #dv{
            /*position:absolute;*/
            /*top:20%;*/
            /*left:50%;*/
            /*transform: translate(-50%,-50%);*/
        }
    </style>
</head>
<body>
<div id="dv">
    <table bordercolor="#CCCCCC" cellspacing="0"align="center" border="1" width="1000px"  >

        <thead  >
        <tr align="left">
            <td colspan="8" ><h3>&nbsp;商品信息管理</h3></td>
        </tr>
        </thead>
        <tr height="60px" align="left">
            <td colspan="8">&nbsp;
                <img src="resources/img/info_seach.png" id="img"/>
                <input id="insearch" type="number" class="user" placeholder="请输要查询的仓库ID"/>
                <button id="search" style="cursor:pointer" onclick="toSeach()">搜索</button>
                <a title="添加" href="merchServlet?method=merchins">    <!--添加的页面-->
                    <img id="add" src="resources/img/info_add.jpg" />
                </a>


            </td>
        </tr>


        <tbody align="center" >
        <tr bgcolor="lightblue" height="50px">
            <th>商品ID</th>
            <th>商品类型ID</th>
            <th>商品名称</th>
            <th>生产日期</th>
            <th>商品价格</th>


        </tr>

        <c:forEach items="${meList.list}" var="item" varStatus="status">
        <tr height="40px" width="100px">
            <td>${item.merchId }</td>
            <td>${item.mertypeId }</td>
            <td>${item.merchname }</td>
            <td>${item.merchdate }</td>
            <td>${item.merchprice }</td>
            <td>
                <input  id="edit" type="button" value="编辑" onclick="updateMe(${item.merchId })">
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <button onclick="deleteMe(${item.merchId })">删除</button>
            </td>
        </tr>
        </c:forEach>
</div>
</body>
<script type="text/javascript">

    function deleteMe(meId){
        if(confirm('确认要删除？'))
        {
            var meId=meId;
            window.location.href="merchServlet?method=marchDel&meId="+meId;
        }

    }
    function updateMe(meId){
        var meId=meId;
        window.location.href="merchServlet?method=merchSignal&meId="+meId;
    }
</script>
</html>
